<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
<title>漂亮的响应式Bootstrap后台管理系统模板MatAdmin</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/bootstrap.min.css" />
<!-- <link rel="stylesheet" href="/phpwmscm/PUBLIC/css/bootstrap-responsive.min.css" /> -->
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/fullcalendar.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/matrix-style.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/matrix-media.css" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/index.css" />
<link href="/phpwmscm/PUBLIC/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link rel="stylesheet" href="/phpwmscm/PUBLIC/css/jquery.gritter.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
<script src="/phpwmscm/PUBLIC/js/jquery-1.8.0.min.js"></script> 
 <style>
		td{
			white-space:nowrap;
			overflow:hidden;
			word-break:keep-all;
		}
	</style>
</head>
<body>
        
<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">MatAdmin</a></h1>
</div>
<!--close-Header-part-->
<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
    <li  class="dropdown" id="profile-messages" ><a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i>  <span id="userbeifn" class="text"><?php echo ($user); ?></span><b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a href="#"><i class="icon-user"></i> 我的资料</a></li>
        <li class="divider"></li>
        <li><a href="#"><i class="icon-check"></i> 我的任务</a></li>
        <li class="divider"></li>
        <li><a href="<?php echo U('Login/logout');?>"><i class="icon-key"></i> 退出</a></li>
      </ul>
    </li>
    <li class="dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">消息</span> <span class="label label-important">5</span> <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a class="sAdd" title="" href="#"><i class="icon-plus"></i> 新消息</a></li>
        <li class="divider"></li>
        <li><a class="sInbox" title="" href="#"><i class="icon-envelope"></i> 收件箱</a></li>
        <li class="divider"></li>
        <li><a class="sOutbox" title="" href="#"><i class="icon-arrow-up"></i> 发件箱</a></li>
        <li class="divider"></li>
        <li><a class="sTrash" title="" href="#"><i class="icon-trash"></i> 发送</a></li>
      </ul>
    </li>
    <li class=""><a title="" href="#"><i class="icon icon-cog"></i> <span class="text">设置</span></a></li>
    <li class=""><a title="" href="<?php echo U('Login/logout');?>"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
  </ul>
</div>
<!--close-top-Header-menu-->
<!--start-top-serch-->
<div id="search">
  <input type="text" placeholder="输入搜索内容..."/>
  <button type="submit" class="tip-bottom" title="Search"><i class="icon-search icon-white"></i></button>
</div>
<!--close-top-serch-->
<div id="sidebar"><a href="#" class="visible-phone"><i class="icon-home"></i> 控制台</a>
  <ul>
    <!-- <li><a href="<?php echo U('Index/index');?>"><i class="icon-home"></i> <span>首页</span></a> </li>
    <li> <a href="<?php echo U('Log/index');?>"><i class="icon-signal"></i> <span>库存单品编码</span></a> </li>
    <li> <a href="<?php echo U('Lsdl/index');?>"><i class="icon-signal"></i> <span>客户门店添加</span></a> </li>
    <li> <a href="<?php echo U('Ls/index');?>"><i class="icon-signal"></i> <span>门店报单编辑</span></a> </li>
    <li class="active"> <a href="<?php echo U('Lsrb/index');?>"><i class="icon-signal"></i> <span>已报订单确认</span></a> </li>
    <li> <a href="<?php echo U('Nslsrb/index');?>"><i class="icon-signal"></i> <span>日报新增删除</span></a> </li>
    <li > <a href="<?php echo U('Sc/index');?>"><i class="icon-signal"></i> <span>商超批量派车</span></a> </li>
    <li> <a href="<?php echo U('Scdl/index');?>"><i class="icon-signal"></i> <span>商超独立派车</span></a> </li>
    <li> <a href="<?php echo U('Wpcmd/index');?>"><i class="icon-signal"></i> <span>未派订单处理</span></a> </li> -->
  </ul>
</div>

<!--sidebar-menu-->

<!--main-container-part-->
<div id="content">
<!--breadcrumbs-->
  <div id="content-header">
    <div id="f"> <a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 首页</a></div>
  </div>
<!-- End-breadcrumbs -->

<!-- Action boxes -->
  
                      <!--  <form action="<?php echo U('Dddy/index');?>" enctype="multipart/form-data" method="post"> -->						
							订单日期开始<input type=date id="dbb1" name=time_1 step=1 value=$_POST[time_1]> 
							订单日期结束<input type=date id="dbb2" name=time_2 step=1 value=$_POST[time_2]> 
							<input type=submit id="fbt8" class="span1" name=submit value=查询> 
							<input type=submit id="fbt9" class="span1" name=submit value=导出数据> 
													
							<div class="control-group">							
							<div class="controls">
					        <input type="text"  list="listItem" placeholder="请选择门店" id="fbt10" name=project_name_1 value="全部">
					        <datalist id="listItem">
					             <option>全部</option>						     
					        </datalist>

					
									配送类型<select name=project_name_2 id="fbt11">	
									    <option>全部</option>									
										<option>市内</option>
										<option>零担</option>
										<option>自提</option>
										<option>市内+零担</option>
										<option>零担+自提</option>
										<option>市内+自提</option>
								    </select>	
								   
									是否已打印<select name=project_name_3 id="fbt12">	
									    <option>未打印</option>	
									    <option>已打印</option>		
									    <option>全部</option>																										
								    </select>								           												         
								</div>
						    </div>					    					
						<!-- </form> -->
                        <button id="fbt3">全选</button><button id="fbt1">打印</button> 							          
						<button id="fbt7">库存分析</button>
						<button id="fbt13">统计预览</button>
<div style="overflow:auto;position: relative;">                       
<div id="wwf">
                     		
</div>
</div>
<!-- End-Action boxes -->    

</div>

<!--end-main-container-part-->

<!--Footer-part-->

<div class="row-fluid">
  <div id="footer" class="span12">Copyright &copy; 2018.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a> </div>
</div>


<script src="/phpwmscm/PUBLIC/js/excanvas.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.ui.custom.js"></script> 
<script src="/phpwmscm/PUBLIC/js/bootstrap.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.flot.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.flot.resize.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.peity.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/fullcalendar.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.dashboard.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.gritter.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.interface.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.chat.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.validate.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.form_validation.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.wizard.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.uniform.js"></script> 
<script src="/phpwmscm/PUBLIC/js/select2.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.popover.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.dataTables.min.js"></script> 
<script src="/phpwmscm/PUBLIC/js/matrix.tables.js"></script> 
<script src="/phpwmscm/PUBLIC/js/mindmup-editabletable-rb.js"></script> 
<script src="/phpwmscm/PUBLIC/js/numeric-input-example.js"></script> 
<script src="/phpwmscm/PUBLIC/js/jquery.mousewheel.js"></script>
<!--end-Footer-part-->

<script type="text/javascript">
//ajax 测试
$.post("/phpwmscm/admin.php/Admin/Dddy/ceshi/",
		    {
		    
		    },
		    function(data,status){	
		    	switch (data) 
		    	{		    	
		        case "1":
		    	{
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsdl/index');?>'><i class='icon-signal'></i> <span>客户门店添加</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ls/index');?>'><i class='icon-signal'></i> <span>门店报单编辑</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsrb/index');?>'><i class='icon-signal'></i> <span>已报订单确认</span></a> </li>");  	
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='<?php echo U('Dddy/index');?>'><i class='icon-signal'></i> <span>订单打印处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Rkcl/index');?>'><i class='icon-signal'></i> <span>单品入库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ddgz/index');?>'><i class='icon-signal'></i> <span>订单出库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        	break;
		    	}
		    	
		        case "2":
		    	{
		        	$('#sidebar').children("ul").append("<li><a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsdl/index');?>'><i class='icon-signal'></i> <span>客户门店添加</span></a> </li>"); 
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ls/index');?>'><i class='icon-signal'></i> <span>门店报单编辑</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Lsrb/index');?>'><i class='icon-signal'></i> <span>已报订单确认</span></a> </li>"); 
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        	  
		        break;
		    	}
		    	
		        case "3":
		    	{ 
		        	$('#sidebar').children("ul").append("<li><a href='<?php echo U('Index/index');?>'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Log/index');?>'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='<?php echo U('Dddy/index');?>'><i class='icon-signal'></i> <span>订单打印处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Rkcl/index');?>'><i class='icon-signal'></i> <span>单品入库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Ddgz/index');?>'><i class='icon-signal'></i> <span>订单出库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='<?php echo U('Kcgl/index');?>'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        	    	
		        break;
		    	}
		    	
		        case "4":
		        {  
		        	
		        break;
		        } 
		        
		        default: 
		        {
		    	break;
		        }
		        
		    	} 
		    	//$("#sidebar").find("li")[0].remove();    
		    });
/////////////////////////////////////////////////////////////////////////////////////////////////	

/////////////////////////////////////////////////////////////////////////////////////////////////		    
//取得日期
function getDate(d1) {

	/* var	d2=Number(d1);//转换为数值。
	var time = new Date();
	var day = ("0" + (time.getDate()+d2)).slice(-2);
	
	var month = ("0" + (time.getMonth() + 1)).slice(-2);
	var today = time.getFullYear() + "-" + (month) + "-" + (day);
	
	return today; */
	var d2 = Number(d1);//转换为数值。
	var time = new Date();
	var n = time.getTime();
	//有多少天的间隔就加上相对应的秒数。
	//console.log(n); 
	n = n + d2 * 24 * 60 * 60 * 1000;
	//console.log(n); 

	var dd = new Date(+n+8*3600*1000);
	var today = dd.toISOString();
	return today.slice(0, 10);
	//console.log(n1.slice(0,10)); 
}
$('#dbb1').val(getDate(0));
$('#dbb2').val(getDate(0));
/////////////////////////////////////////////////////////////////////////////////////////////////
//动态设置下拉列表
$.post("/phpwmscm/admin.php/Admin/Dddy/tjajaxsicp/",
		 {
		 		    
		 },
		 function(data,status){	
			
			    var temparr1=data;//取回	    	
		    	varDb_arr1 = temparr1.split(',');//转换为数组
		    	
		    	//console.log(varDb_arr1);
		    			 		
		 		for (var ig = 0; ig < varDb_arr1.length; ig=ig+1) 
		 		{  		
		 			
		 			$('#listItem').append('<option value="' + varDb_arr1[ig] + '">'+ varDb_arr1[ig] +'</option>');
		 		} 
		 		
		});

//$('#tablea').editableTableWidget();
//打印
$('#fbt1').click(function(){	 
	//提交打印就会认为已经打印，会写入数据库，不在打印页面处理了。 
	//把需要选中的订单发送给打印页面。
	var r=confirm("是否打印!");
	    if (r==true)
	    {   
	    	  var  temp2Arr="";//缓存check 
	    	  
	    	  //input:checkbox:checked 选中input下的checkbox的checked选中值。
	    	  $('table').find("input:checkbox:checked").each(function(){
	    			
	    	  	   var temp=$(this).val();
	    	  	   temp2Arr=temp2Arr+temp+",";//生成1,2,3这样的id字符串	    			    
	    			   
	    	  	   });
	    	  var temp2=temp2Arr.slice(0,temp2Arr.length-1);//去掉最后一个 逗号 ，	
	    	  //console.log(temp2);
	    	  
	      $.post("<?php echo U('Dyym/ajaxqrdd');?>",
 	    		    {
	    	          arr2:temp2, 
	    	          user:$('#userbeifn').text()
 	    		    },
 	    		    function(data,status){
 	    		    	console.log(data);    	    		    	
 	    		    }); 
	     
	      
	      window.open("<?php echo U('Dyym/index');?>");
		}
 		else
 		{			
 		    alert("未打印!");
 		}	  
 });
 //全选
 $('#fbt3').click(function(){
	    var r=confirm("是否全选!");
		if (r==true)
		{   
	 
	
	
	     $('table').find("input:checkbox").each(function(){
		 
  	     var temp=$(this).prop("checked",true);
		 
		
	     });//选中所有复选框
	
	 
		  	  
	        alert("已全选!");
		}
 		else
 		{			
 			 $('table').find("input:checkbox").each(function(){	 
 		  	 var temp=$(this).prop("checked",false);
 			});//选中所有复选框
 		    alert("未全选!");
 		}	  
	 
 });
//查询
 $('#fbt8').click(function(){
	 //查询前 清空所有元素。
	 $('#wwf').empty()
	 $.post("/phpwmscm/admin.php/Admin/Dddy/tjajaxceshi/",
	 		    { 		      
	 		      arr1: $('#dbb1').val(), 
	 		      arr2: $('#dbb2').val(), 
	 		      arr3: $('#fbt10').val(), 	
	 		      arr4: $('#fbt11').val(), 	
	 		      arr5: $('#fbt12').val(), 	
	 		    },
	 		    function(data,status){ 		
	 		    	var temparr1=data.slice(0,data.search("fenge"));
			    	var temparr2=data.slice(data.search("fenge")+5,data.length);
	 		    	
			    	var j1=$.parseJSON(temparr1);			    	
			    	var j2=$.parseJSON(temparr2);
			    	//保存变量
			    	//console.log(j2);
			    	var tanblestart= "<table  class='table table-bordered table-striped'>";
			    	var tanbleend= "</table>";
			    	
			    	
			    	var btbtid1="btbtone";
			    	var btbtid2="btbttow";
			    	var btbtid3="kgbj";
			    	
	 		    	for(var i=0;i<j1.length;i++)
	 		    	{
	 		    		var aa1=btbtid1+i;
	 		    		var bb1=btbtid2+i;
	 		    		var cc1=btbtid3+i;
	 		    		
	 		    		//表头
	 		    		var biaogearr="";
	 		    		biaogearr=biaogearr+tanblestart;
	 		    	
	 		    		biaogearr=biaogearr + "<th><nobr><input type=checkbox style='position: relative; left: 0px; top: -55px; right:0px ' value="+j1[i].etddbm+"></nobr></th>"+"<thead id="+aa1+">"
	 		    		     + "<tr>"
	 		    		     + "<th><nobr></nobr></th>"
	 		    		     + "<th><nobr>订单状态:"+j1[i].querendd+"|-|</nobr></th>"
	 		    		     + "<th><nobr>订单编码:"+j1[i].etddbm+"|-|</nobr></th>"
	 		    		     + "<th style='color:#f0f'><nobr>订单日期:"+j1[i].ddriqi+"|-|</nobr></th>"
	 		    		     + "<th style='color:#f0f'><nobr>送货日期:"+j1[i].pcriq+"|-|</nobr></th>"
	 		    		     + "<th><nobr>客户:"+j1[i].khmc+"|-|</nobr></th>"
	 		    		     + "<th><nobr>门店:"+j1[i].khmd+"|-|</nobr></th>"
	 		    		     + "<th style='color:#f0f'><nobr>收货人:"+j1[i].shr+"|-|</nobr></th>"
	 		    		     + "<th style='color:#f0f'><nobr>收货人电话:"+j1[i].shrdh+"|-|</nobr></th>"
	 		    		     + "<th style='color:#f0f'><nobr>三方订单号:"+j1[i].sfddh+"|-|</nobr></th>"
	 		    		    + "<th><nobr>地址:"+j1[i].mddz+"|-|</nobr></th>"
	 		    		     + "</tr>"
	 		    		     + "<tr>"
	 		    		     + "<th><nobr></nobr></th>"
	 		    		    
	 		    		     + "<th style='color:#f0f'><nobr>订单备注:"+j1[i].ddbeizhu+"|-|</nobr></th>"
	 		    		     + "<th style='color:#f0f'><nobr>配送类型:"+j1[i].pslx+"|-|</nobr></th>"	
	 		    		     + "<th style='color:#f0f'><nobr>订单推送人:"+j1[i].ddscz+"|-|</nobr></th>"	
	 		    		     + "<th style='color:#f0f'><nobr>订单推送时间:"+j1[i].scrqsj+"|-|</nobr></th>"	
	 		    		    + "<th style='color:#f0f'><nobr>打印次数:"+j1[i].dybj+"|-|</nobr></th>"	
							 + "</tr>"
							 + "</thead>"
							 + "<tbody id="+bb1+">"
							 + "<tr>"
							 + "<th><nobr>配送类型</nobr></th>"
							 + "<th><nobr>序号</nobr></th>"
							 + "<th><nobr>商品编码</nobr></th>"
							 + "<th><nobr>品名</nobr></th>"
							 + "<th><nobr>商品条码</nobr></th>"
							 + "<th><nobr>单品规格</nobr></th>"
							 + "<th><nobr>箱规</nobr></th>"
							 + "<th><nobr>货物类型</nobr></th>"
							 + "<th style='color:#f0f'><nobr>件数</nobr></th>"
							 + "<th style='color:#f0f'><nobr>重量</nobr></th>"
							 + "<th style='color:#f0f'><nobr>备注</nobr></th>"	
							
							 + "</tr>";
							 var tempjssjs=0;
							 var ysslzj=0;
							 var xhcx=0;
							 for(var a=0;a<j2.length;a++)
							 {								
								 if(j1[i].etddbm==j2[a].etddbm){
								 //合计送货数量	 
								 tempjssjs=tempjssjs+Number(j2[a].shjs);		
								 //计算并合计验收总数
								 var tempjsyssl=Number(j2[a].shjs)/Number(j2[a].xianggui);
								 ysslzj=ysslzj+tempjsyssl;
								 //序号重新计算
								 xhcx=xhcx+1
								 biaogearr= biaogearr
								 + "<tr>"
								 + "<th class=pmsl><nobr>"+j1[i].pslx+"</nobr></th>"
								 + "<th><nobr>"+xhcx+"</nobr></th>"
								 + "<th><nobr>"+j2[a].spbm+"</nobr></th>"
								 + "<th class=pmsl><nobr>"+j2[a].pinming+"</nobr></th>"
								 + "<th><nobr>"+j2[a].sptm+"</nobr></th>"
								 + "<th><nobr>"+j2[a].dpgg+"</nobr></th>"
								 + "<th><nobr>"+j2[a].xianggui+"</nobr></th>"
								 + "<th><nobr>"+j2[a].hwlx+"</nobr></th>"
								 + "<th class=pmsl style='color:#f0f'><nobr>"+j2[a].shjs+"</nobr></th>"
								 + "<th style='color:#f0f'><nobr></nobr></th>"
								 + "<th style='color:#f0f'><nobr>"+j2[a].dpbeizhu+"</nobr></th>"																																					
								 + "</tr>";
								 }											
							 }  
							 biaogearr= biaogearr
							 + "<tr>"
							 + "<th><nobr></nobr></th>"
							 + "<th><nobr></nobr></th>"	
							 + "<th><nobr></nobr></th>"
							 + "<th><nobr></nobr></th>"
							 + "<th><nobr></nobr></th>"
							 + "<th><nobr></nobr></th>"
							 + "<th><nobr></nobr></th>"
							 + "<th><nobr>合计</nobr></th>"
							 + "<th><nobr>"+tempjssjs+"</nobr></th>"
							 + "<th><nobr></nobr></th>"
							 + "<th><nobr></nobr></th>"
							 + "</tr>";
						biaogearr= biaogearr+ "</tbody>"+tanbleend;						
	 		    		$('#wwf').append(biaogearr);
//////////////////////////////////////////////////////////////////////////////////////	    		
						var iDatejsdt = "<script type='text/javascript'>";												   
						iDatejsdt=iDatejsdt	
						+"$('#"+bb1+"').hide();"
						+"var "+cc1+"=0;"
				    	+"$('#"+aa1+"').click(function(){"
				    	+"switch ("+cc1+")" 
				    	+"{"		    	
				    	+"case 0:"
				    	+"{"
				    	+"$('#"+bb1+"').hide(100);"
				    	+" "+cc1+"=1;"
				    	+"break;"
				    	+"}"
				    	+"case 1:"
				    	+"{"
				    	+"$('#"+bb1+"').show(100);"
				    	+" "+cc1+"=0;"
				    	+"break;"
				    	+"}"
				    	+"default:" 
				    	+"{"
				    	+"break;"
				    	+"}"			    		    
				    	+"}" 	
				    	+"});";
				    	iDatejsdt=iDatejsdt+"<\/script>";
				    	$('#wwf').append(iDatejsdt);
				    		
	 		    	}	 		   	
	 		   });
	
});	 	
 var kcsj1="";
// 打开页面就提取 当天的库存数据 品名+批次+库位。 
$.post("<?php echo U('Kcgl/ajaxdppccx');?>",
				 {
 		    
				 },
				 function(data,status){	
					 //console.log(data);
					 kcsj1=$.parseJSON(data);	
					 console.log(kcsj1);
				});
//库存分析				
 $('#fbt7').click(function(){
	    var r=confirm("是否分析库存!");
		if (r==true)
		{ 
			var temp2Arr="";
			$('.pmsl').each(function(){
			   		
		     	   var temp=$(this).text();		     	  
		   		   temp2Arr=temp2Arr+temp+",";//生成1,2,3这样的id字符串		   		 
		     });
			var temp2 = temp2Arr.slice(0, temp2Arr.length - 1);
			
            //console.log(temp2);
			//把最新的库存数据提交给统计页面，由它自己处理数据。
			$.post("<?php echo U('Kcfx/tjajaxSc');?>",
					 {
	 		          arr1:kcsj1,
	 		          arr2:temp2,
					 },
					 function(data,status){	
						 console.log(data);
						
					});
		  window.open("<?php echo U('Kcfx/index');?>");
		}
 		else
 		{			
 			
 		    alert("未处理!");
 		}	  
	 
 });	  
	 		    			
//库存分析				
 $('#fbt13').click(function(){
	    var r=confirm("是否统计预览!");
		if (r==true)
		{ 
			
			$.post("<?php echo U('Ddtj/tjajaxsicpdytj');?>",
					 {
	 		       
					 },
					 function(data,status){	
						 console.log(data);
						
					});
		  window.open("<?php echo U('Ddtj/index');?>");
		}
 		else
 		{			
 			
 		    alert("未处理!");
 		}	  
	 
 });	  
	
</script>
</body>

</html>